home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 695 < prev    next >
Internet Message Format  |  1996-08-06  |  886b

  1. Path: isonews.bbn.hp.com!news
  2. From: Bruno RICHARD <bruno_richard@hp-france-om1.om.hp.com>
  3. Newsgroups: comp.std.c
  4. Subject: int main(void) or int main()?
  5. Date: 4 Apr 1996 19:21:51 GMT
  6. Organization: Hewlett-Packard
  7. Message-ID: <4k17gf$gob@isoit109.bbn.hp.com>
  8. NNTP-Posting-Host: gplbrd.grenoble.hp.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  13.  
  14. What is the recommended declaration for a function that does
  15. not take arguments and does not return anything:
  16.  
  17.    void myfunc();
  18. or
  19.    void myfunc(void);
  20.  
  21. I remember that few years ago on Turbo C 2.0 the second form was better
  22. optimized. So I got used to do so, but I just read the C FAQ and noticed
  23. that there was some argument about main() returning int or void, and
  24. I am wondering whether there could be some portability problems around.
  25.  
  26. -bruno
  27.  
  28.